﻿<%@ Page Language="C#" MasterPageFile="~/MainMaster.Master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="Mang24k99.Web.Dissertation.ChildNews.List" Title="24k99后台管理系统-专题子新闻添加" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" language="javascript" src="../../Calendar/JSCalendar.js"></script>
<script type ="text/javascript" language ="javascript" src="../../Js/jquery-1.2.6.min.js" ></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script language="javascript" type="text/javascript">
        $(function(){
            $('#ctl00_ContentPlaceHolder1_SpecialName').bind("keyup",function(event){
                var code=$('#ctl00_ContentPlaceHolder1_SpecialName').val();
                var sKeyCode = event.keyCode;
                if(sKeyCode >64 &&sKeyCode<91){
                    $.get('../Dissertation.ashx?param='+code,function(result){
                        $('#selectColumn').show();
                        $('#selectColumn').html(result);
                        $("#selectColumn").css({"left":$('#ctl00_ContentPlaceHolder1_SpecialName').offset().left,"top":$('#ctl00_ContentPlaceHolder1_SpecialName').offset().top+20});
                    });
                }
            });
            
        });
        
        //添加选择项
        function selectColumn(columnid,val){
            document.all.ctl00_ContentPlaceHolder1_SpecialName.value='';
            $('#searchTable').hide();
            var select = document.all.ctl00_ContentPlaceHolder1_ColumnList;
            for(var f=0;f<select.options.length;f++){
                if(columnid==select.options[f].value)
                    return;
            }
            select.options[0].selected=false;
            $("<option value='"+columnid+"' selected='selected'>"+val+"</option>").appendTo('#ctl00_ContentPlaceHolder1_ColumnList');
            document.all.ctl00_ContentPlaceHolder1_columnIDs.value+=columnid+'+';
        }
        
//        //移出选择项
//        function deleteItem(){
//            var select = document.all.ctl00_ContentPlaceHolder1_ColumnList;
//            if(select.options.length>0&&select.selectedIndex>-1){
//                document.all.ctl00_ContentPlaceHolder1_columnIDs.value = document.all.ctl00_ContentPlaceHolder1_columnIDs.value.replace(select.options[select.selectedIndex].value+'+','');
//                select.removeChild(select.options[select.selectedIndex]);
//            }
//        }
        
        //勾选子新闻
        function exChange(obj,i){
            var theme="ctl00_ContentPlaceHolder1_disAddNews_ctl(.*)_cbNews(.*)";
            var reg=obj.id.match(theme);
            var bun=reg[1];
            var y=0;
            if(i<5)y=1;
            else if(i>4&&i<9)y=5;
            else if(i>8&&i<13)y=9;
            for(var x=y;x<=3+y;x++){
                if(x!=i)
                    document.getElementById("ctl00_ContentPlaceHolder1_disAddNews_ctl"+bun+"_cbNews"+x).checked=false;
            }
        }
    </script>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" height="34" align="center" background="../../Images/bg1.jpg">
        <tr>
            <td class="nav" style="width:50%;text-align:left">您当前的位置:
                <asp:Label ID="SpecialWeb" runat="server">FX168</asp:Label>网站专题子新闻维护
            </td>
            <td class="nav" style="width:50%;text-align:right">您的身份:<asp:Label ID="identity" runat="server">系统管理员</asp:Label></td>
        </tr>
    </table>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" height="34px" align="center">
        <tr style="padding-top:10px">
            <td class="nav" style="width:20%;text-align:left">
            网站选择：    
            </td>
            <td><asp:DropDownList ID="selectWeb" runat="server" AutoPostBack="true" 
                    onselectedindexchanged="selectWeb_SelectedIndexChanged" CssClass="forms" 
                    Width="108px">
                    <asp:ListItem Value="1" Selected="True">FX168</asp:ListItem>
                    <asp:ListItem Value="2">24K99</asp:ListItem>
                </asp:DropDownList></td>
        </tr>
        <tr style="padding-top:10px">
            <td class="nav" style="width:20%;text-align:left">
                选择上线时间:
            </td>
            <td style="width:25%"><asp:TextBox ID="startTime" onclick="JSCalendar(this)" Width="70px" runat="server"></asp:TextBox>
                到 <asp:TextBox ID="endTime" Width="70px" onclick="JSCalendar(this)" runat="server"></asp:TextBox></td>
            <asp:Panel ID="fx168Dis" runat="server">
                <td class="nav" style="width:12%;text-align:left">
                    维护专题:
                </td>
                <td style="width:15%;"><asp:DropDownList ID="selectDisseratation" runat="server" AutoPostBack="true" onselectedindexchanged="selectDisseratation_SelectedIndexChanged" CssClass="forms">
                        <asp:ListItem Selected="true" Value="0">专题一,二,三</asp:ListItem>
                        <asp:ListItem Selected="False" Value="1">专题一</asp:ListItem>
                        <asp:ListItem Selected="False" Value="2">专题二</asp:ListItem>
                        <asp:ListItem Selected="False" Value="3">专题三</asp:ListItem>
                        <asp:ListItem Selected="False" Value="4">专题四</asp:ListItem>
                        <asp:ListItem Selected="False" Value="5">专题五</asp:ListItem>
                    </asp:DropDownList></td>
            </asp:Panel>
            <td>
                <asp:CheckBox ID="bindNews" runat="server" Text="已绑定" />&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:LinkButton  ID="Search" runat="server" 
                    Text="查询" onclick="Search_Click" CssClass="col" />
            </td>
        </tr>
    </table>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" height="34px" align="center">
        <tr style="padding-top:10px">
            <td class="nav" style="text-align:left;width:135px;vertical-align:top;">
                选择新闻栏目:
            </td>
            <td style="width:120px;"><asp:TextBox ID="SpecialName" runat="server" Width="102px"></asp:TextBox>
                <div id="selectColumn" style="width:102px;position: absolute;"></div></td>
            <td style="vertical-align:top;">
                <asp:DropDownList ID="ColumnList" runat="server" CssClass="forms">
                    <asp:ListItem Value="0" Selected="True">已选择栏目</asp:ListItem>
                </asp:DropDownList>
                <asp:HiddenField ID="columnIDs" runat="server" />&nbsp;&nbsp;&nbsp; 
                <a id="clearSelected" 
                    onmouseover='this.style.cursor="hand";' 
                    onclick="javascript:document.all.ctl00_ContentPlaceHolder1_ColumnList.options.length=1;document.all.ctl00_ContentPlaceHolder1_columnIDs.value='';" 
                    class="form_btn">清除</a>
            </td>
        </tr>
        <tr>
        <td colspan="4" align="right">&nbsp;&nbsp;&nbsp;&nbsp;<asp:LinkButton 
                ID="AddSpecial" runat="server" 
                Font-Underline="true" onclick="AddSpecial_Click" 
                Text="添加参考文件" CssClass="col" />
            &nbsp;&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="SettingSort" runat="server" Font-Underline="true" 
                onclick="SettingSort_Click" Text="修改参考文件" 
                CssClass="col" />&nbsp;&nbsp;
            </td>
        </tr>
    </table>
        <table border="1" cellpadding="0" id="dissertationNewsSelect" cellspacing="0" width="99%" align="center" bordercolor="#BED6A6" style="border-collapse: collapse">
        <%if (ViewState["DissNumber"].ToString() == "0")
          {%>
        <tr>
            <td rowspan="3" class="tb_title2" style="width:120px;">新闻标题</td><td rowspan="3" class="tb_title2">上线时间</td><td colspan="4" class="tb_title2">专题一</td><td colspan="4" class="tb_title2">专题二</td><td colspan="4" class="tb_title2">专题三</td>
        </tr>
        <tr>
            <td colspan="4" class="tb_title2"><asp:Label ID="disTitle1" runat="server"></asp:Label></td>
            <asp:HiddenField ID="disID1" runat="server" />
            <td colspan="4" class="tb_title2"><asp:Label ID="disTitle2" runat="server"></asp:Label></td>
            <asp:HiddenField ID="disID2" runat="server" />
            <td colspan="4" class="tb_title2"><asp:Label ID="disTitle3" runat="server"></asp:Label></td>
            <asp:HiddenField ID="disID3" runat="server" />
        </tr>
        <tr>
            <td class="tb_title2">相关报道</td><td class="tb_title2">相关评论</td><td class="tb_title2">研究报告</td><td class="tb_title2">参考文件</td>
            <td class="tb_title2">相关报道</td><td class="tb_title2">相关评论</td><td class="tb_title2">研究报告</td><td class="tb_title2">参考文件</td>
            <td class="tb_title2">相关报道</td><td class="tb_title2">相关评论</td><td class="tb_title2">研究报告</td><td class="tb_title2">参考文件</td>
        </tr>
        <%}
          else if (int.Parse(ViewState["DissNumber"].ToString()) > 25)//预上线专题
          { %>
        <tr>
            <td rowspan="3" class="tb_title2">新闻标题</td><td rowspan="3" class="tb_title2">上线时间</td><td colspan="4" class="tb_title2">预上线专题</td>
        </tr>
        <tr>
            <td colspan="4" class="tb_title2">
                <asp:Label ID="willDiss" runat="server"></asp:Label>
                <asp:HiddenField ID="willHiddenField" runat="server" />
            &nbsp;</td>
        </tr>
        <tr><td class="tb_title2">相关报道</td><td class="tb_title2">相关评论</td><td class="tb_title2">研究报告</td><td class="tb_title2">参考文件</td></tr>
        <%} else{%>
        <tr>
            <td rowspan="3" class="tb_title2" style="width:100px;">新闻标题</td>
            <td rowspan="3" class="tb_title2">上线时间</td>
            <td colspan="4" class="tb_title2">
                <asp:Label ID="DisTitleName" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="4" class="tb_title2">
                <asp:Label ID="oneDiss" runat="server"></asp:Label>
                <asp:HiddenField ID="oneHiddenField" runat="server" />
            </td>
        </tr>
        <tr class="tb_title2"><td class="tb_title2">相关报道</td><td class="tb_title2">相关评论</td><td class="tb_title2">研究报告</td><td class="tb_title2">参考文件</td></tr>
        <%} %>
    <asp:Repeater ID="disAddNews" runat="server" onitemdatabound="disAddNews_ItemDataBound">
        <ItemTemplate>
            <tr>
                <td class="tb_txt2">
                    <%#Eval("NewsTitle").ToString()%>
                    <asp:HiddenField ID="newsID" runat="server" Value='<%#Eval("NewsID")%>' />
                </td>
                <td class="tb_txt2"><%#StandardTime(Eval("LastUpdateTime").ToString())%></td>
                <td class="tb_txt2"><asp:CheckBox ID="cbNews1" onclick="exChange(this,1)" runat="server" Checked="false" /></td>
                <td class="tb_txt2"><asp:CheckBox ID="cbNews2" onclick="exChange(this,2)" runat="server" Checked="false" /></td>
                <td class="tb_txt2"><asp:CheckBox ID="cbNews3" onclick="exChange(this,3)" runat="server" Checked="false" /></td>
                <td class="tb_txt2"><asp:CheckBox ID="cbNews4" onclick="exChange(this,4)" runat="server" Checked="false" /></td>
                <%if (ViewState["DissNumber"].ToString() == "0")
                  { %>
                    <td class="tb_txt2"><asp:CheckBox ID="cbNews5" onclick="exChange(this,5)" runat="server" Checked="false" /></td>
                    <td class="tb_txt2"><asp:CheckBox ID="cbNews6" onclick="exChange(this,6)" runat="server" Checked="false" /></td>
                    <td class="tb_txt2"><asp:CheckBox ID="cbNews7" onclick="exChange(this,7)" runat="server" Checked="false" /></td>
                    <td class="tb_txt2"><asp:CheckBox ID="cbNews8" onclick="exChange(this,8)" runat="server" Checked="false" /></td>
                    <td class="tb_txt2"><asp:CheckBox ID="cbNews9" onclick="exChange(this,9)" runat="server" Checked="false" /></td>
                    <td class="tb_txt2"><asp:CheckBox ID="cbNews10" onclick="exChange(this,10)" runat="server" Checked="false" /></td>
                    <td class="tb_txt2"><asp:CheckBox ID="cbNews11" onclick="exChange(this,11)" runat="server" Checked="false" /></td>
                    <td class="tb_txt2"><asp:CheckBox ID="cbNews12" onclick="exChange(this,12)" runat="server" Checked="false" /></td>
                <%} %>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
    <tr>
        <td colspan="14">
            <webdiyer:AspNetPager ID="NewsPager" AlwaysShow="true" runat="server" Height="22px" OnPageChanged="NewsPager_PageChanged"
                PageSize="20" FirstPageText="首页" LastPageText="末页" ShowInputBox="Always" NextPageText="下一页" PrevPageText="上一页">
            </webdiyer:AspNetPager>
        </td>
    </tr>
    </table>
        <%--<script type="text/javascript">
            addTrHover("dissertationNewsSelect");
        </script>--%>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" height="34px" align="center">
        <tr style="padding-top:10px">
            <td class="nav" style="width:40%;text-align:right">
                <asp:Button ID="OK" runat="server" Text="保存" onclick="OK_Click" 
                    CssClass="form_btn"/></td>
            <td class="nav" style="width:60%;text-align:center">
                <asp:Button ID="Cancel" runat="server" Text="取消" onclick="Cancel_Click" 
                    CssClass="form_btn"/>
            </td>
        </tr>
    </table>
</asp:Content>
